package com.ethereal.petmanagement.util;

public class CodeMsg {
    private Integer code;//错误码
    private String msg;//错误信息


    //处理成功消息码
    public static CodeMsg SUCCESS = new CodeMsg(0, "success");

    //登录注册功能失败错误码
    public static CodeMsg PHONE_NOT_REGISTERED = new CodeMsg(100, "手机号未注册！");
    public static CodeMsg PASSWORD_ERROR = new CodeMsg(101, "密码错误！");
    public static CodeMsg PHONE_ALREADY_EXIST = new CodeMsg(102, "手机号已注册！");
    public static CodeMsg REGISTER_ERROR_DATABASE = new CodeMsg(103, "注册失败，数据库插入失败！");
    public static CodeMsg CAPTCHA_ERROR = new CodeMsg(104, "验证码错误，请重新输入！");

    //用户功能失败错误码
    public static CodeMsg PARAMETER_FORMAT_ERROR = new CodeMsg(201, "输入字段不符合规范，请重新输入！");
    public static CodeMsg USER_NOT_LOGIN = new CodeMsg(202, "用户尚未登录，请重新登录！");

    //宠物功能失败错误码
    public static CodeMsg PET_ADD_ERROR = new CodeMsg(301, "宠物添加失败，请稍后再试！");
    public static CodeMsg PET_DELETE_ERROR = new CodeMsg(302, "宠物删除失败，请稍后再试！");


    //抛出异常处理
    public static CodeMsg DATABASE_ERROR = new CodeMsg(103, "数据库异常，请稍后再试！");
    public static CodeMsg SERVLET_ERROR = new CodeMsg(103, "Servlet异常，请稍后再试！");












    public CodeMsg(Integer code, String msg){
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
